<?php
namespace UserApi\Controller;
use Zend\Mvc\Controller\AbstractRestfulController;
use Zend\View\Model\JsonModel;
class DiscountsApiController extends AbstractRestfulController
{
    public function getList()
    {
    }
    public function get($user_id)
    {
		header('Access-Control-Allow-Origin: *');
		$discountTable=$this->getServiceLocator()->get('Models\Model\DiscountsFactory');			
		$userDiscounts = $discountTable->userDiscounts($user_id)->toarray();
		if(count($userDiscounts)!=0){
			return new JsonModel(array(
				'output'	=> 'success',
				'data'		=>	json_encode($userDiscounts),
			));
		}else{
			return new JsonModel(array(
				'output'	=> 'fail',
			));
		}
    }
    public function create($reviewAndRating)
    {
		
    }
    public function update($id, $s_eamil)
    {
		
    }
    public function delete($id)
    {
       
    }
}